home *** CD-ROM | disk | FTP | other *** search
- /*********************************************************************
- * T.Shimomura's Macro Collection という程のこともない(^_^;)
- *********************************************************************/
-
- #ifndef TSMACRO_H
- #define TSMACRO_H
-
- /* 配列の要素数を求めるELEMENTS_OFマクロ */
- #define ELEMENTS_OF(array) (sizeof(array)/sizeof((array)[0]))
-
- /* デバッグ用PRINTFマクロ */
- /* DEBUGが定義されていると、出力を行う */
- #if defined(DEBUG)
- # define PRINTF(p) (printf p)
- #else
- # define PRINTF(p) ((void) 0)
- #endif
-
- #define iskanji(c) \
- ((0x81 <= (c) && (c) <= 0x9F) || (0xE0 <= (c) && (c) <= 0xFC))
- #define iskanji2(c) \
- ((0x40 <= (c) && (c) <= 0x7E) || (0x80 <= (c) && (c) <= 0xFC))
- #define isprkana(c) \
- (((c) < 0x80 && isprint(c)) || ((c) >= 0xA1 && (c) <= 0xDF))
-
- #endif
-